
package guoan.domain;

import guoan.core.jodaJson.DateTimeYYYYMMDDHHMMSSSerializer;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import org.hibernate.annotations.Type;
import org.joda.time.DateTime;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;

/**
 * Media
 */
@Entity
public class Media implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * ID 自动增长
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * mediaId
     */
    private String mediaId;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = DateTimeYYYYMMDDHHMMSSSerializer.class)
    @Type(type = "org.jadira.usertype.dateandtime.joda.PersistentDateTime")
    @Column(name = "create_time")
    private DateTime createTime;

    /**
     * 简介
     */
    private String type;

    /**
     * 图片URL
     */
    @Column(name = "file_url")
    private String fileUrl;

    public Long getId(){
        return id;
    }

    public void setId(Long id){
        this.id = id;
    }

    public String getMediaId(){
        return mediaId;
    }

    public void setMediaId(String mediaId){
        this.mediaId = mediaId;
    }

    public DateTime getCreateTime(){
        return createTime;
    }

    public void setCreateTime(DateTime createTime){
        this.createTime = createTime;
    }

    public String getType(){
        return type;
    }

    public void setType(String type){
        this.type = type;
    }

    public String getFileUrl(){
        return fileUrl;
    }

    public void setFileUrl(String fileUrl){
        this.fileUrl = fileUrl;
    }

}